<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

    <style>
        /* 实现原理
        1.首先要一个盒子
        2.宽高为0
        3.主要靠边框线来实现
        4.想要哪边的三角形就给其余三个边框线的位置设为透明色
         */
        div {
            width: 0;
            height: 0;
            border-left: 200px solid transparent;
            border-top: 200px solid transparent;
            border-bottom: 200px solid red;
            border-right: 200px solid transparent;
        }

        p {
            width: 0;
            height: 0;
            border-left: 400px solid blue;
            border-right: 400px solid transparent;
            border-bottom: 400px solid transparent;
            border-right: 400px solid transparent;
        }
    </style>
</head>

<body>
    <div></div>
    <p></p>
</body>

</html>